#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
int n,m,k,u[N],v[N],flg[N],vis[N],x,ans,now,fa[N],dep[N],lst[N];
vector<int> e[N],edge[N];
struct node{
	int x,y;
};
vector<node> pr;
inline void dfs(int u){
	vis[u]=1,edge[u].clear();
	if(flg[u]) now++;
	for(auto &i:e[u])
		if(!vis[i]) edge[u].push_back(i),fa[i]=u,dep[i]=dep[u]+1,dfs(i);
}
inline void dfs1(int u){
	vector<int> now;
	now.clear();
	for(auto &i:edge[u]){
		dfs1(i);
		if(lst[i]) now.push_back(lst[i]);
	}
	if(flg[u]) now.push_back(u);
	int siz=now.size();
	for(int i=0;i+1<siz;i+=2)
		pr.push_back({now[i],now[i+1]});
	if(siz&1) lst[u]=now[siz-1];
}
inline void work(int x,int y){
	vector<int> put,put1;
	put.clear(),put1.clear();
	if(dep[x]<dep[y]) swap(x,y);
	while(dep[x]>dep[y])
		put.push_back(x),x=fa[x];
	while(x!=y)
		put.push_back(x),put1.push_back(y),x=fa[x],y=fa[y];
	put.push_back(x);
	reverse(put1.begin(),put1.end());
	for(auto &i:put1)
		put.push_back(i);
	cout<<(int)put.size()<<" ";
	for(auto &i:put)
		cout<<i<<" ";
	cout<<"\n";
}
signed main(){
	freopen("travel.in","r",stdin);
	freopen("travel.out","w",stdout);
	ios::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
	cin>>n>>m>>k;
	for(int i=1;i<=m;i++){
		cin>>u[i]>>v[i];
		e[u[i]].push_back(v[i]),e[v[i]].push_back(u[i]);
	}
	for(int i=1;i<=k;i++){
		cin>>x;
		flg[x]=1;
	}
	for(int i=1;i<=n;i++)
		if(!vis[i]){
			now=0,dep[i]=1;
			dfs(i);
			ans+=now/2;
			dfs1(i);
		}
	cout<<ans<<"\n";
	for(auto &i:pr)
		work(i.x,i.y);
	return 0;
}